define(['app'], function(app) {
    'use strict';

    // 实例化方法
    var factory = function(Http) {

        function get_data_videos(result) {
            if(false) {
                result = '{"success":true,"msg":"","result":{"info":[{"id":"001","title":"这是我的推送标题","method":"站内推送","store_type":"五金店铺","status":1,"reason":"没有按要求经营，所以不给通过，望理解"},{"id":"002","title":"这是我的推送标题2","method":"站内推送2","store_type":"五金店铺2","status":2,"reason":"没有按要求经营，所以不给通过，望理解"}]},"session":"7311da98bd0f18eb15a96bcb263f4153"}';
                return JSON.parse(result);
            } else {
                return result;
            }
        }

        // 返回信息
        return {
            getvideolist: function(status, nPage, callback, calldone) {
                Http.post({
                    method: 'info.message.getlist',
                    status: status,
                    nPage: nPage
                },
                function(result) {
                    //请求成功
                    if(callback)
                        callback(get_data_videos(result).result);
                },
                function(e) {
                    //请求异常
                },
                function() {
                    //请求完成，一般不做什么事情
                    if(calldone)
                        calldone();
                });
            },
            del_info: function(id, callback) {
                Http.post({
                    method: 'info.message.delete',
                    id: id
                },
                function(result) {
                    //请求成功
                    if(callback)
                        callback(result);
                },
                function(e) {
                    //请求异常
                },
                function() {
                    //请求完成，一般不做什么事情
                });
            }
            
            
        };
    }

    factory.$inject = ['Http'];
    return app.registerService("Starbusiness_pushinfo", factory);

});